package com.oms;

import org.hibernate.Session;
import com.oms.entities.User;

public class Main {
	
	 public static void main(String[] args) {
		 
		 Session session = HibernateUtil.getSessionFactory().openSession();
		 
		 User user = new User();
		 
		 user.user_id = 1;
		 user.name = "Anatoly";
		 user.surname = "Rodin";
		 user.setLogin("SuperHuman");
		 user.setPassword("JavaCourse");
		 user.setEmail("anatolyr1@gmail.com");
		 user.setAddress("Sevastopol Avenue");
		 user.setPhone("0665036638");
		 user.setRegion((byte)0);
		 user.setStatus((byte)0);
		 
		 session.beginTransaction();
		 session.save(user);
		 session.getTransaction().commit();
		 System.out.println("OK");
		 
		 session.close();
		 
		 }
	
}
